[0.89-fb] [HBASE-10291] Fix potential L2 related NPE, honor L2 cache on write for Index blocks

Author: arjen

Summary: D1112816 left a possiblity for a NPE while checking for availibility of the L2 cache. Also the cache on write flag for the inline index writer was not honored if it would be false.

Test Plan: Code review and running the unit tests.

Reviewers: liyintang

Reviewed By: liyintang

Differential Revision: https://phabricator.fb.com/D1123851

Task ID: 2567910

git-svn-id: https://svn.apache.org/repos/asf/hbase/branches/0.89-fb@1558527 13f79535-47bb-0310-9956-ffa450edef68