fixes #1187, refactor log det and type bug in array alloc

#### Summary:

1.  Refactors log determinant calcs to use standard array allocation in the arena and the precomputed gradient types.  

2.  Fix bug in array allocation with extra `*` in type so all allocations were of pointer sizes.

#### Intended Effect:

(1) Make log det easier to understand and (2) fix bug.

#### How to Verify:

There's a unit test that tickles (2) in Stan 2.5 and is fixed now.  (1) is a judgment call, but should be easy to see.

#### Side Effects:

None.

#### Documentation:

Nothing user facing.

#### Reviewer Suggestions:

Anyone.