Dialyzer Fixes

Addresses some warnings found in dialyzer mostly by correcting type specs. One dead code branch is removed. Complete list of warnings found on master (db17fcc515c): https://gist.github.com/176895ea43b1f41ea3c2. Notes about which warnings are fixed can be found in the commit messages. 

Note: you will need a rebar that contains [this commit](https://github.com/rebar/rebar/commit/e7be6874d7dded06659a055d497247aba1c90b4c) in order to run dialyzer without crashing on `riak_core_pb` not being compiled with `debug_info`. I used `basho/rebar` master. This PR does not include a change to rebar (figured that could be done separately when we decide what version).