Netty and shuffle  bug fixes

This patch fixes some bugs in the recent netty shuffle refactoring. This also fixes a DiskBlockObjectWriter bug where some blocks were reported to have zero size when using kryo. Thanks to @jey for catching this and @rxin for various suggestions.