Add preexec hook support to bash

Copied from jml/undistract-me@2f1ebd1f107a807800cb8753630bfe058940cc05