engine: Fix for RHBZ#968958 - Refactor unnecessary while loop

Fixing unnecessary while loop in JndiAction class.
Under any circumstances the while loop runs only once,
hence it's not necessary and simple "if" statement can do the same.

Change-Id: I938726d631ac4ccb91cc68791e8e349dd43895ea
Bug-Url: https://bugzilla.redhat.com/968958
Signed-off-by: Tomas Dosek <tdosek@redhat.com>