Convex Approach To Data-Driven Optimal Control With Safety Constraints Using Linear Transfer Operator