fix T4201 to avoid GNU grep specific -B option by usage of pure POSIX tools

Test Plan: validated on Linux and tested on Solaris

Reviewers: austin

Reviewed By: austin

Subscribers: phaskell, simonmar, relrod, ezyang, carter

Differential Revision: https://phabricator.haskell.org/D135