Add tests for bugs reported against riak_core: 917, 918

Rebased: https://github.com/basho/riak_test/pull/612