Backport fix in issue 73 to 1.3 branch

It was desired to have the sink-sync-send crash fix backported to the 1.3 branch. This is a cherry-pick of commit 041cee5, which fixed the issue in pull request #73. The tests tests that demonstrate the issue have not been backported, to save merge hassle. To run the tests, cherry-pick the other commits from #73 (you'll have to resolve a minor conflict in `riak_pipe_fitting.erl`, to make sure that the PULSE includes are added).