Reintroduce graceful shutdown test and fix some bugs it helped find.
Bump version.