Currently g:actual_curbuf is only available in a statusline expression, i.e. '%{neomake#statusline#get()}', but not when used inside of a function that returns the statusline ('set statusline=%!MyStatusLine()', where MyStatusLine uses neomake#statusline#get()`).
I think it would be useful to have it set also for %!… already.