Josh Tongue took three big wickets in quick succession as England moved within sight of a three-day win against Pakistan.