java: Keep track of thread frames

This is needed by the MPS GC for scanning GC roots.

Signed-off-by: Pekka Enberg <penberg@iki.fi>