Simplify resource locating in templatelayout

We don't need to check every appwebroot ourself, use OC_App code.

This is the original code from pr #3019 

@icewind1991 @zimba12 @eMerzh @tanghus